<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>项目介绍</title>
    <link rel="stylesheet" type="text/css" href="./css/api.css" />
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="./css/style.css" />
    <script type="text/javascript" src="./script/api.js"></script>
    <script type="text/javascript" src="./script/aui-tab.js" ></script>
    <link rel="stylesheet" type="text/css" href="./css/aui-slide.css" />
    <script type="text/javascript" src="./script/aui-slide.js"></script>
    <script type="text/javascript" src="./script/base.js"></script>
    <script type="text/javascript" src="./script/doT.min.js"></script>
    <script type="text/javascript" src="./script/jquery-3.2.0.js"></script>
    <script type="text/javascript">
        function closeWin(){
            api.closeWin({
            });
        };
    </script>
</head>
<body>
 <!-- 头部 -->
 <header class="aui-bar aui-bar-nav pos" style="position: fixed; top:0; left:0">
    <a class="aui-pull-left aui-btn" onclick="closeWin()">
        <span class="aui-iconfont aui-icon-left"></span>
    </a>
    <div class="aui-title">项目介绍</div>
</header>
<div class="header-d"></div>
<link rel="stylesheet" type="text/css" href="./css/aui-slide3.css" />
<div class="licai-proinfo">
    <h3 id="title"></h3>
    <div id="des"></div>
</div>
<!--     <div id="aui-slide3">
        <div class="aui-slide-wrap" >
            <div class="aui-slide-node bg-dark">
                <img src="./image/demo/1.jpeg" />
            </div>
            <div class="aui-slide-node bg-dark">
                <img src="./image/demo/2.jpeg" />
            </div>
            <div class="aui-slide-node bg-dark">
                <img src="./image/demo/3.jpeg" />
            </div>
        </div>
        <div class="aui-slide-page-wrap"></div>
    </div> -->
</body>

<script type="text/javascript">
//     var slide = new auiSlide({
//     container:document.getElementById("aui-slide3"), //容器
//     // "width":100, //宽度
//     "height":300, //高度
//     "speed":500, //速度
//     "autoPlay": 3000, //自动播放
//     "loop":true,//是否循环
//     "pageShow":true,//是否显示分页器
//     "pageStyle":'dot', //分页器样式，分dot,line
//     'dotPosition':'center' //当分页器样式为dot时控制分页器位置，left,center,right
// })
    
    apiready = function(){

        id = api.pageParam.id;
        load_list(id);

    }

    // 加载列表
    function load_list(id) {

        api.showProgress({
            style: 'default',
            animationType: 'fade',
            title: '努力加载中...',
            text: '先喝杯茶...',
            modal: false
        });

        api.ajax({
            url: webAddress+'/index.php?ctl=app_deal&act=deal&id='+id,
            method: 'get',
        },function(ret, err){

            if (ret) {

                if (ret.status == 0) {
                    alert(ret.info);
                }else {
                    // alert( JSON.stringify( ret ) );

                    var array = new Array();
                    array[0] = ret.deal.icon.replace(/.\/public\/attachment/g, 'http://www.big-wealth.com/public/attachment');
                    for (var i = 0; i < ret.deal.mortgage_infos.length; i++) {
                        array[i+1] = ret.deal.mortgage_infos[i].img.replace(/.\/public\/attachment/g, 'http://www.big-wealth.com/public/attachment');
                    }
                    document.getElementById('title').innerHTML = ret.deal.name+' '+ret.deal.deal_sn;
                    var str = ret.deal.description;
                    load_scrollview(array, str);
                    api.hideProgress();
                }
            } else {
                alert( JSON.stringify( err ) );
                api.hideProgress();
            }
        });
    }

    // 加载轮播图
    function load_scrollview(array, str) {
        var UIScrollPicture = api.require('UIScrollPicture');
        document.getElementById('des').innerHTML = str;
        var textHeight = $('.aui-bar').height();
        UIScrollPicture.open({
            rect: {
                x: 0,
                y: textHeight + 25,
                w: api.winWidth,
                h: api.winWidth
            },
            data: {
                paths: array
                // captions: ['apicloud', 'apicloud', 'apicloud', 'apicloud']
            },
            styles: {
                caption: {
                    // height: 35,
                    color: '#E0FFFF',
                    size: 13,
                    bgColor: '#696969',
                    position: 'bottom'
                },
                indicator: {
                    align: 'center',
                    color: '#FFFFFF',
                    activeColor: '#DA70D6'
                }
            },
            // placeholderImg: 'widget://res/slide1.jpg',
            contentMode: 'scaleToFill',
            interval: 3,
            fixedOn: api.frameName,
            loop: true,
            fixed: true
        }, function(ret, err) {
            if (ret) {
                // alert(JSON.stringify(ret));
            } else {
                // alert(JSON.stringify(err));
            }
        });

        var a = api.winWidth;
        $('.licai-proinfo').css('margin-top', a - 20);

    }


</script>
</html>
